package com.txts.road.app.system.controller;

import com.txts.road.app.system.model.dto.FeedbackDTO;
import com.txts.road.app.system.model.vo.SystemConfigVO;
import com.txts.road.app.system.service.SystemConfigService;
import com.txts.base.common.domain.ResponseDTO;
import io.swagger.v3.oas.annotations.Operation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.*;

import jakarta.validation.Valid;

import java.util.List;


/**
 * 系统配置前端控制层
 *
 * @author baoyr
 * @since 2025-07-17 10:43
 */
@Tag(name = "系统配置接口")
@RestController
@RequestMapping("/api/v1/system-config")
@RequiredArgsConstructor
public class SystemConfigController {

    private final SystemConfigService systemConfigService;

    /**
     * 获取系统配置
     */
    @Operation(summary = "获取系统配置")
    @GetMapping("/config")
    public ResponseDTO<List<SystemConfigVO>> getSystemConfig() {
        return ResponseDTO.ok(systemConfigService.getSystemConfig());
    }


    /**
     * 获取关于我们
     */
    @Operation(summary = "获取关于我们")
    @GetMapping("/about")
    public ResponseDTO<String> getAboutUs() {
        return ResponseDTO.ok(systemConfigService.getAboutUs());
    }

    /**
     * 意见反馈
     */
    @Operation(summary = "意见反馈")
    @PostMapping("/feedback")
    public ResponseDTO<Boolean> submitFeedback(@Valid  @RequestBody FeedbackDTO feedbackDTO) {
        return ResponseDTO.ok(systemConfigService.submitFeedback(feedbackDTO));
    }


}
